package com.ysh.smartplatform.mapper;

import com.ysh.smartplatform.pojo.SysCategory;
import com.ysh.smartplatform.pojo.SysDevice;
import com.ysh.smartplatform.pojo.SysLogininfor;
import com.ysh.smartplatform.pojo.SysUserOnline;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 袁胜虎 on 2022/9/8 20:04
 */
public interface DeviceMapper {

    @Select("select * from sys_device where device_id = #{id}")
    SysDevice findByDeviceId(String id);

    void bindDevice(SysDevice sysDevice);

    @Delete("delete from sys_device where device_id = #{id}")
    void deleteDevice(String id);

    @Update("update  sys_device set device_name = #{deviceName}, categy_id = #{categyId},scene_id = #{sceneId}  where  device_id = #{deviceId}")
    void updateDevice(SysDevice sysDevice);

    @Select("select * from sys_device")
    List<SysDevice> findAllDevices();

    int updateDeviceStatus(@Param("deviceId") String deviceId,@Param("status") int status);

    Long findByCategoryId(String deviceId);

    int updateByPrimaryKeySelective(SysDevice record);
}
